<div class="row">
    <div class="col">
        <%= if (errors) { %>
            <%= for (key, val) in errors { %>
                <div class="alert alert-danger alert-dismissible fade show m-1" role="alert">
                    <%= val %>
                    <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                    </button>
                </div>
            <% } %>
        <% } %>
    </div>
</div>
<div class="row mt-3 justify-content-center">
    <div class="col-md-8 col-sm-10">
        <h2>Edit this post</h2>
        <form action="<%= editPostsPath({pid: post.ID}) %>" method="POST">
            <%= csrf() %>
            <div class="form-group">
                <label for="title">Title</label>
                <input type="text" name="Title" class="form-control" id="title" value="<%= post.Title %>">
            </div>
            <div class="form-group">
                <label for="content">Content</label>
                <textarea class="form-control" name="Content" id="content"  rows="20"><%= post.Content %></textarea>
            </div>
            <button type="submit" class="btn btn-primary">Update</button>
        </form>
    </div>
</div>
